//package com.ruoyi;
//
//import java.awt.KeyEventDispatcher;
//import java.awt.KeyboardFocusManager;
//import java.awt.MouseInfo;
//import java.awt.Point;
//import java.awt.event.KeyEvent;
//import java.awt.event.MouseEvent;
//
//import java.awt.event.KeyEvent;
//import java.awt.event.KeyListener;
//import java.awt.event.MouseEvent;
//import java.awt.event.MouseListener;
//import javax.swing.JFrame;
//
//import org.jnativehook.GlobalScreen;
//import org.jnativehook.NativeHookException;
//import org.jnativehook.keyboard.NativeKeyEvent;
//import org.jnativehook.keyboard.NativeKeyListener;
//import org.jnativehook.mouse.NativeMouseEvent;
//import org.jnativehook.mouse.NativeMouseListener;
//
//public class GlobalEventListener implements NativeKeyListener, NativeMouseListener {
//    public static void main(String[] args) {
//        try {
//            // 初始化全局事件监听器
//            GlobalScreen.registerNativeHook();
//        } catch (NativeHookException ex) {
//            System.err.println("无法注册本机钩子");
//            System.exit(1);
//        }
//
//        // 添加键盘事件监听器
//        GlobalScreen.addNativeKeyListener(new GlobalEventListener());
//
//        // 添加鼠标事件监听器
//        GlobalScreen.addNativeMouseListener(new GlobalEventListener());
//    }
//
//    @Override
//    public void nativeKeyPressed(NativeKeyEvent e) {
//        System.out.println("键盘按下：" + NativeKeyEvent.getKeyText(e.getKeyCode()));
//    }
//
//    @Override
//    public void nativeMouseClicked(NativeMouseEvent e) {
//        System.out.println("鼠标点击：" + e.getButton());
//    }
//
//    // 其他事件回调方法...
//
//    @Override
//    public void nativeKeyReleased(NativeKeyEvent e) {
//    }
//
//    @Override
//    public void nativeKeyTyped(NativeKeyEvent e) {
//    }
//
//    @Override
//    public void nativeMousePressed(NativeMouseEvent e) {
//    }
//
//    @Override
//    public void nativeMouseReleased(NativeMouseEvent e) {
//    }
//
//
//}